home *** CD-ROM | disk | FTP | other *** search
/ Aminet 35 / Aminet 35 (2000)(Schatztruhe)[!][Feb 2000].iso / Aminet / dev / gui / gui4cli.lha / Gui4Cli / G4C / FSearch / FSearch.ed next >
Encoding:
Text File  |  1999-10-15  |  1.4 KB  |  51 lines

  1. G4C
  2.  
  3. ; =================================================================
  4. ; Contains routines to interface FSearch.gc gui with a text editor. 
  5. ; The editor in this case is CygnusEd 3.5 (the one I use), but the
  6. ; routines can be changed for any editor.
  7. ; =================================================================
  8.  
  9. ; CHANGE THE PATH HERE TO YOUR SET UP
  10.  
  11. xRoutine Check4CedBar ; this is called by other functions in here.
  12.  
  13.     ; if cedbar is not running, fire it up..
  14.     ifexists gui ~cedbar.gc
  15.         ifexists file sq1:guis/cedbar/cedbar.gc  ; my setup
  16.             guiload sq1:guis/cedbar/cedbar.gc
  17.         else
  18.             ezreq 'Could not find CedBar.gc' OK ''
  19.             stop ; do nothing..
  20.         endif
  21.     endif
  22.  
  23. ; -----------------------------------------------------------------
  24. ; Load a file & goto given line or byte.
  25. ; filename : the name of the file to be loaded
  26. ; byte     : the position you want to goto (in bytes)
  27. ; -----------------------------------------------------------------
  28.  
  29. xRoutine LoadFile filename offset
  30.  
  31.     gosub #this Check4CedBar ; stop if not found..
  32.  
  33.     sendrexx $cedbar.gc/cedport 'jump to file $filename'
  34.     if $$rexxret = 0    ; file not loaded
  35.         sendrexx $cedbar.gc/cedport 'open new'
  36.         sendrexx $cedbar.gc/cedport 'open $filename'
  37.     endif
  38.     sendrexx $cedbar.gc/cedport 'expand view'
  39.  
  40.     if $offset > 0
  41.         if $fsearch.gc/lineswitch == LINE
  42.             sendrexx $cedbar.gc/cedport 'jump to line $offset'
  43.         else
  44.             sendrexx $cedbar.gc/cedport 'jump to byte $offset'
  45.         endif
  46.     endif
  47.  
  48.  
  49.  
  50.  
  51.